package top.xtcoder.jdcbase.base.entity.base;

import javax.validation.constraints.NotBlank;

import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.ColType;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Comment;
import org.nutz.dao.entity.annotation.Default;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;

import io.swagger.annotations.ApiModelProperty;
import top.xtcoder.jdcbase.base.entity.BaseEntity;

/**
 * 账号基础信息
 * @author xiangtao
 *
 */
public class AccountInfo extends BaseEntity {
	@Column("account")
	@ColDefine(type=ColType.VARCHAR, width=100)
	@Comment(value="登录账号(工号/学号)")
	@ApiModelProperty(value="登录账号(工号/学号)")
	@NotBlank(message = "登录账号不能为空")
	private String account;
	
	@Column("password")
	@ColDefine(notNull=false, type=ColType.TEXT)
	@Comment(value="密码 需要前端md5加密")
	@ApiModelProperty(value="密码 需要前端md5加密")
	@JsonProperty(access = Access.WRITE_ONLY) 
	private String password;
	
	@Column("salt")
	@ColDefine(notNull=false, type=ColType.VARCHAR, width=20)
	@Comment(value="密码加密盐")
	@JsonIgnore
	@ApiModelProperty(hidden = true)
	private String salt;
	
	@Column("state")
	@ColDefine(notNull=false,type=ColType.INT, width=3)
	@Comment(value="状态 0 禁用 1 启用")
	@ApiModelProperty(value="状态 0 禁用 1 启用")
	@Default("0")
	private int state;
	
	@Column("logint")
	@ColDefine(type=ColType.VARCHAR, width=25)
	@Comment(value="上一次登陆时间")
	@ApiModelProperty(value="上一次登陆时间")
	private String loginutime;
	/**
	* 上一次登陆ip
	*/
	@Column("loginuip")
	@ColDefine(type=ColType.VARCHAR, width=50)
	@Comment(value="上一次登陆ip")
	@ApiModelProperty(value="上一次登陆ip")
	private String loginuip;
	
	@Column("loginip")
	@ColDefine(type=ColType.VARCHAR, width=25)
	@Comment(value="这一次登陆时间")
	@ApiModelProperty(value="这一次登陆时间")
	private String logintime;
	
	@Column("logintime")
	@ColDefine(type=ColType.VARCHAR, width=50)
	@Comment(value="这一次登陆ip")
	@ApiModelProperty(value="这一次登陆ip")
	private String loginip;

	@Column("usertype")
	@ColDefine(notNull=false,type=ColType.INT)
	@Comment(value="用户类型")
	@ApiModelProperty(value="用户类型")
	@Default("0")
	private int usertype;

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getLoginutime() {
		return loginutime;
	}

	public void setLoginutime(String loginutime) {
		this.loginutime = loginutime;
	}

	public String getLoginuip() {
		return loginuip;
	}

	public void setLoginuip(String loginuip) {
		this.loginuip = loginuip;
	}

	public String getLogintime() {
		return logintime;
	}

	public void setLogintime(String logintime) {
		this.logintime = logintime;
	}

	public String getLoginip() {
		return loginip;
	}

	public void setLoginip(String loginip) {
		this.loginip = loginip;
	}

	public int getUsertype() {
		return usertype;
	}

	public void setUsertype(int usertype) {
		this.usertype = usertype;
	}
}
